<template>
  <div class="roomNumber">
    <el-container>
      <div class="head" id="head1">
        <div class="tit">{{pageName}}
        </div>
        <el-form :inline="true" :model="formInline" ref="formInline" class="demo-form-inline">
          <el-form-item prop="block">
            <el-select size="mini" v-model="formInline.block" placeholder="幢号">
              <el-option label="杭州" value="hangzhou"></el-option>
              <el-option label="上海" value="shanghai"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="unit">
            <el-select size="mini" v-model="formInline.unit" placeholder="单元">
              <el-option label="杭州" value="hangzhou"></el-option>
              <el-option label="上海" value="shanghai"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
            <span @click="resetForm('formInline')" class="reset">
              <i class="icon iconfont icon-icon901"></i> 重置
            </span>
          </el-form-item>
        </el-form>
      </div>
      <el-main :style="'height:'+height+'px'">
          <roomNumberList></roomNumberList>
      </el-main>
      <el-footer id="foot">
        <el-pagination size="mini" background layout="total,sizes,prev, pager, next" :total="1000"></el-pagination>
      </el-footer>
    </el-container>
    <roomDetail></roomDetail>
  </div>
</template>
<script>
import roomNumberList from './roomNumberList.vue'
import roomDetail from './roomDetail.vue'
export default {
  data() {
    return {
      height: 0,
      formInline: {
        block: "",
        unit: ""
      },
      pageName:'左邻右舍公寓'
    };
  },
  created() {},
  methods: {
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    onSubmit() {
      console.log("submit!");
    },
  },
  mounted() {
    let height = `${document.documentElement.clientHeight}`;
    let headH = document.getElementById("head1").offsetHeight;
    let footH = document.getElementById("foot").offsetHeight;
    console.log(headH)
    this.height = parseInt(height) - (headH + footH+62);
  },
  components:{
    roomNumberList, //房号列表
    roomDetail,   //房屋详细数据 弹框
  },
};
</script>
<style lang="less" scoped>
.roomNumber {
  width: 100%;
  padding-top: 123px;
  height: 100%;
  box-sizing: border-box;
  padding-bottom: 60px;
  position: relative;
  .head {
    background: #ffffff !important;
    text-align: left;
    font-size: 16px;
    overflow: hidden;
    box-shadow: 0px -3px 22px -1px #999;
    padding: 0px 20px;
    border-bottom: 1px solid #eeeeee;
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    box-sizing: border-box;
  }
  .head .tit {
    line-height: 60px;
    color: #222222;
    font-weight: 700;
  }
  .el-form-item__label {
    float: left !important;
  }
  .el-form-item__label::after {
    float: left !important;
  }
  .el-form-item__label::before {
    float: left !important;
  }
  .el-main {
    padding: 20px;
    height: 100%;
  }
  .el-footer {
    background: #f5f5f5;
    line-height: 60px;
    text-align: right;
    padding: 15px;
    overflow: hidden;
    border-top: 1px #eeeeee solid;
    position: absolute;
    left: 0px;
    bottom: 0px;
    width: 100%;
    box-sizing: border-box;
    
  }

  .el-form-item__label {
    float: right;
  }
}
.reset {
  margin-left: 20px;
  color: #97a8be !important;
  cursor: pointer;
}
.head {
  .add {
    font-weight: 700;
    color: #3399ff;
    float: right;
    font-size: 14px;
    cursor: pointer;
  }
}
</style>